package com.usian.ai.controller;

import com.usian.ai.common.Result;
import com.usian.ai.common.vo.QuestionLibReqVo;
import com.usian.ai.common.vo.QuestionLibSaveReqVo;
import com.usian.ai.service.QuestionLibService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 12 10 09 04
 **/

@RestController
@RequestMapping("/questionLib")
@CrossOrigin
@Slf4j
public class QuestionLibController {


    final
    QuestionLibService questionLibService;


    public QuestionLibController(QuestionLibService questionLibService) {
        this.questionLibService = questionLibService;
    }


//    @RequestMapping("/addQuestionLib")
//    public String addQuestionLib(String question, Integer interviewerId){
//        return questionLibService.addQuestionLib(question,interviewerId);
//    }

    @RequestMapping("/listQuestionLibs")
    public Result listQuestionLibs(@RequestBody QuestionLibReqVo questionLibReqVo){
        return questionLibService.listQuestionLibs(questionLibReqVo);
    }



    @PostMapping("/addQuestionLib")
    public Result addQuestionLib(@RequestBody @Validated  QuestionLibSaveReqVo questionLibSaveReqVo){
        return questionLibService.addQuestionLib(questionLibSaveReqVo);

    }
}
